﻿$(function () {

    new Swiper(".swiper-container", {
        pagination: ".swiper-dots",
        navigator: {
            prev: ".swiper-btn-prev",
            next: ".swiper-btn-next"
        },
        delay: 5000, // 切换的时间 默认2000
        autoPlay: true // 是否自动切换 默认true
    });

    //最新揭晓栏
    var tim = setInterval(function () {
        var tag = $(".newjx > .home-newjx-item:first");
        if ($(".newjx > .home-newjx-item").length <= 3) {
            clearInterval(tim);
            return;
        }
        var w = tag.width();
        anime({
            targets: tag[0],
            marginLeft: "-" + (w + 30) + "px",
            easing: "linear",
            duration: 2000,
            complete: function () {
                tag.remove().css("margin-left", "0");
                $(".newjx").append(tag);
            }
        })
    }, 5000);

    if ($("#gomyyg").css("display") != "none") {
        showMask();
    }

    function showMask(){
        $("#gomyyg").css("display", "flex");
        anime({
            targets: "#gomyyg .center",
            duration: 2000,
            scale: [0, 1],
            delay: 800
        })
    }
  
    $("#gomyyg .close").on("click", function () {
        $("#gomyyg").fadeOut(500);
    })
})